-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gopsutil to stop calling SetEnv #3041
Conversation
} | ||
sysctl, err := exec.LookPath("/sbin/sysctl") | ||
if err != nil { | ||
return []string{}, err | ||
} | ||
out, err := exec.Command(sysctl, "-n", mib).Output() | ||
cmd := exec.Command(sysctl, "-n", mib) | ||
cmd.Env = hostEnv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're setting the execution environment for just the sysctl
call, wouldn't it be easier to just always override with LC_ALL=C
? The locale change has limited scope and should not affect Nomad executor. In fact, the original code was done to avoid any possible locale-induced parsing problem, so LC_ALL=C
is a desirable thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what you're trying to say. This change sets LC_ALL=C just for this subprocess that needs it instead of setting it globally and having unintentional side effects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right you are.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Pulls in shirou/gopsutil#417
Fixes #3036